// path用来处理文件路径

const path = require("path");

// path.resolve用来做路径拼接
console.log(path.resolve("/a", "/b"));
console.log(path.resolve("/a", "./b"));
console.log(path.resolve("/a", "b"));
console.log(path.resolve(__dirname, "./b"));
console.log(path.resolve(__dirname, "../b"));

// 获取文件夹的名字用的
console.log(path.dirname(__dirname))

// 获取文件的后缀名
console.log(path.extname("a.bc.jpg"))